/*
 * 文件名:SysConstant.java
 * 创建时间:2010-03-10
 * 版本:1.0
 * 版权所有:杨涛
 */
package com.yangtao.framework.common;

import java.io.Serializable;

/**
 * 封装系统消息的类
 *
 * @author 杨涛
 * @version 1.0
 * @see com.yangtao.framework.web.struts2.BaseModel
 */
public class Message implements Serializable {

	/**
	 *
	 */
	private static final long serialVersionUID = 1L;
	/**
	 * 消息的key
	 */
	private String key;
	/**
	 * 对应的元素
	 */
	private String elementId;
	/**
	 * 消息参数
	 */
	private String[] args;
	/**
	 * 消息文本
	 */
	private String text;
	/**
	 * 消息类型，默认为提示消息
	 */
	private int type = SystemConstant.INFO;

	/**
	 * @param key
	 */
	public Message(String key) {
		super();
		this.key = key;
	}

	/**
	 * @param key
	 * @param elementId
	 */
	public Message(String key, String elementId) {
		super();
		this.key = key;
		this.elementId = elementId;
	}

	/**
	 * @param key
	 * @param args
	 */
	public Message(String key, String[] args) {
		super();
		this.key = key;
		this.args = args;
	}

	/**
	 * @param key
	 * @param elementId
	 * @param args
	 */
	public Message(String elementId, String key, String[] args) {
		super();
		this.key = key;
		this.elementId = elementId;
		this.args = args;
	}

	/**
	 * 构造函数
	 *
	 * @param elementId 元素Id
	 * @param key   消息Key
	 * @param args  消息参数
	 * @param type  消息类型
	 */
	public Message(String elementId, String key, String[] args, int type) {
		super();
		this.key = key;
		this.elementId = elementId;
		this.args = args;
		this.type = type;
	}

	/**
	 * @return the key
	 */
	public String getKey() {
		return key;
	}

	/**
	 * @param key the key to set
	 */
	public void setKey(String key) {
		this.key = key;
	}

	/**
	 * @return the elementId
	 */
	public String getElementId() {
		return elementId;
	}

	/**
	 * @param elementId the elementId to set
	 */
	public void setElementId(String elementId) {
		this.elementId = elementId;
	}

	/**
	 * @return the args
	 */
	public String[] getArgs() {
		return args;
	}

	/**
	 * @param args the args to set
	 */
	public void setArgs(String[] args) {
		this.args = args;
	}

	/**
	 * @return the text
	 */
	public String getText() {
		return text;
	}

	/**
	 * @param text the text to set
	 */
	public void setText(String text) {
		this.text = text;
	}

	/**
	 * @return the type
	 */
	public int getType() {
		return type;
	}

	/**
	 * @param type the type to set
	 */
	public void setType(int type) {
		this.type = type;
	}

}
